#!/bin/python3

import cv2 as cv
import numpy as np


if __name__ == '__main__':
    left = cv.FileStorage("build/yolov8_resized.yml", cv.FileStorage_READ)
    right = cv.FileStorage("/home/kx/Documents/iss_app/build/install/image.yml", cv.FileStorage_READ)

    self_data = left.getNode("test").mat()
    print(self_data[0:20, 0, 0])

    other_data = right.getNode("test").mat()
    print(other_data[0:20, 0, 0])

    compare_data = np.abs(self_data - other_data)
    print(compare_data.shape)

    print(type(compare_data))

    compare_result = np.where(compare_data > 10e-8, 255, 0)
    cv.imwrite("build/compare_result.png", compare_result)
    # print(compare_result)